package org.magneato.dto;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * Facets can have a number of values, each value has a count
 * 
 * Factet -> value (count), value (count), value (count)
 * 
 * @author dgeorge
 */
public class FacetItem {
	private String name;
	private List<FacetValue> facetList;

	public FacetItem(String name) {
		this.name = name;
		facetList = new ArrayList<FacetValue>();
	}

	public void addFacet(String value, int count) {
		FacetValue facetValue = new FacetValue(value, count);
		facetList.add(facetValue);
	}

	public String getName() {
		return name;
	}
	
	public int size() {
		return facetList.size();
	}
	
	public Iterator<FacetValue> getFacetList() {
		return facetList.iterator();
	}
}
